import type { RouteRecordRaw } from "vue-router";

// 获取modules中的路由规则
// https://cn.vitejs.dev/guide/features.html#glob-import
const modules = import.meta.glob("@/routers/modules/**/*.ts", { eager: true });

// modules AsyncRoutes
const AsyncRoutes: RouteRecordRaw[] = [];

Object.keys(modules).forEach(key => {
  const cc = modules[key] as any;
  AsyncRoutes.push(...cc.default);
});

export default AsyncRoutes;
